Editor.Shapes.VocabIndividual = function (u, i) {
	if (i == undefined) {
		i = this;
	}
	Editor.Shapes.ResourceConnectable.call(this, u, i);

	this.circle = new Editor.Decks.CircleVocabIndividual();
	this.circle.init(this);
}

Editor.Util.inherits(Editor.Shapes.VocabIndividual, Editor.Shapes.ResourceConnectable);

Editor.Shapes.VocabIndividual.prototype.draw = function () {
	Editor.Shapes.VocabIndividual.superClass_.draw.call(this, this);
	this.circle.draw();
	//this._resize(Editor.CONFIG.RESOURCE_SHAPE_WIDTH - this.getWidth(), Editor.CONFIG.RESOURCE_SHAPE_HEIGHT - this.getHeight());
}

Editor.Shapes.VocabIndividual.prototype.remove = function () {
	var arrProperties = Array();
	for (var i = 0; i < this.inProperties.length; i++) {
		var s = Editor.STATE.SHAPES.get(this.inProperties[i]);
		if (!s.getIsDeleted()) {
			arrProperties.push(this.inProperties[i]);
		}
	}
	var resource = this;
	var impl = this;
	var arrConnections = new Array();
	var cmd = new JS.Command({
		execute: function () {
			Editor.Shapes.VocabIndividual.superClass_._remove.call(impl);
			impl.circle.remove();
			impl.draggerConnector.remove();
			for (var i = 0; i < arrProperties.length; i++) {
				var s = Editor.STATE.SHAPES.get(arrProperties[i]);
				if (!s.getIsDeleted()) {
					s._remove();
					Editor.Util.removeConnections(s.getUuid(),arrConnections);
				}
			}
			Editor.Util.removeConnections(impl.getUuid(),arrConnections);
		},
		undo: function () {
			impl.draw();
			for (var i = 0; i < arrProperties.length; i++) {
				var s = Editor.STATE.SHAPES.get(arrProperties[i]);
				if (s.getIsDeleted()) {
					s.draw();
				}
			}
			Editor.Util.unremoveConnections(arrConnections);
		},
		stack: Editor.STATE.CMDSTACK
	});
	cmd.name = 'remove vocabindividual';
	cmd.execute();
}

Editor.Shapes.VocabIndividual.prototype._remove = function () {
	Editor.Shapes.VocabIndividual.superClass_._remove.call(this);
	this.circle.remove();
}

Editor.Shapes.VocabIndividual.prototype.toFront = function () {
	Editor.Shapes.VocabIndividual.superClass_.toFront.call(this);
	this.circle.toFront();
}

Editor.Shapes.VocabIndividual.prototype.translate = function (dx, dy) {
	if (dx != 0 || dy != 0) {
		Editor.Shapes.VocabIndividual.superClass_.translate.call(this, dx, dy);
		this.circle.translate(dx, dy);
	}
}

Editor.Shapes.VocabIndividual.prototype._translate = function (dx, dy) {
	if (dx != 0 || dy != 0) {
		Editor.Shapes.VocabIndividual.superClass_._translate.call(this, dx, dy);
		this.circle.translate(dx, dy);
	}
}

Editor.Shapes.VocabIndividual.prototype._resize = function (dw, dh) {
	if (dw != 0 || dh != 0) {
		Editor.Shapes.VocabIndividual.superClass_._resize.call(this, dw, dh);
		this.circle.redraw();
		this.circle.toFront();
	}
}

Editor.Shapes.VocabIndividual.prototype.resize = function (dw, dh) {
	if (dw != 0 || dh != 0) {
		Editor.Shapes.VocabIndividual.superClass_.resize.call(this, dw, dh);
		this.circle.redraw();
		this.circle.toFront();
	}
}

// get
Editor.Shapes.VocabIndividual.prototype.getTypeClass = function () {
	return "vocabIndividual";
}

Editor.Shapes.VocabIndividual.prototype.getInfo = function () {
	var str = '';
	if (Editor.CONFIG.DEBUG) {
		str = 'Vocab Individual:\n';
		str += '---------------\n';
	}
	str += Editor.Shapes.VocabIndividual.superClass_.getInfo.call(this);
	return str;
}

Editor.Shapes.VocabIndividual.prototype.toObject = function () {
	return {
		'type': 'vocabIndividual',
		'resource': Editor.Shapes.VocabIndividual.superClass_.toObjectResource.call(this)
	}
}

Editor.Shapes.VocabIndividual.prototype.getShapeAttr = function () {
	return Editor.CONFIG.VOCABINDIVIDUAL_SHAPE_ATTR;
}
